package com.lcm.weam;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;


@EnableTransactionManagement
@EnableAsync //开启异步
@EnableScheduling  //开启定时控制 秒 分 小时 日期 月份 星期 年份
@SpringBootApplication(scanBasePackages = "com.lcm.weam")
@MapperScan(value = "com.lcm.weam.dao")
public class WeamApplication {
    public static void main(String[] args) {
        SpringApplication.run(WeamApplication.class);
    }

    //mybatis-plus分页插件引入, 或者写mybatis配置类中
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.POSTGRE_SQL));
        return interceptor;
    }
}
